package cn.iocoder.yudao.module.cms.benefit.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.api.cms.benefit.BenefitApi;
import cn.iocoder.yudao.module.api.cms.benefit.dto.BenefitRespDTO;
import cn.iocoder.yudao.module.cms.benefit.dal.dataobject.BenefitDO;
import cn.iocoder.yudao.module.cms.benefit.service.BenefitService;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  权益保障 API 实现
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/12/20
 */
@Service
@Validated
public class BenefitApiImpl implements BenefitApi {
    @Resource
    private BenefitService benefitService;

    @Nonnull
    @Override
    public List<BenefitRespDTO> getBenefitList(String category) {
        List<BenefitDO> list = benefitService.getBenefitList(category);
        return BeanUtils.toBean(list, BenefitRespDTO.class);
    }

}
